#include <stdio.h>
#include "picpredef.h"
#include "dkpx.h"
#include "display.h"
#include "p16spii2c.h"
#include "keyboard.h"
#include "daout.h"


extern union BYTEBITDEF cKeyConByte;
extern union BYTEBITDEF cDisConByte;
extern union BYTEBITDEF cSysConByte;
extern volatile bank0	 struct stWorkStatu workstatu;

volatile unsigned int pppp;

void            currdata2ccp(unsigned int p)
{
   byte            i;

	pppp = p;

   p = p <<6 ;
   CCPR1L = p / 256;
   i = p % 256;

   i = i >> 2;
   CCP1CON &= 0b11001111;
   CCP1CON |= i;
   
  if ( CCPR1L < 25 )
  {
	  GODONE = 0 ; ADIF = 0; ADON = 0 ;
	
   }
   else
   {
	   i = ( ADON ) ?0:1;
	   ADON  = 1;
	   if  (i  )
	   	GODONE = 1;
	   
}
}

